import logging

import requests
import pytest
class Testcase():
    uid=""
    sid=""
    def setup_method(self):
        print("开始")
    def teardown_method(self):
        print("结束")
    def test_dl(self):
        try:
            url="http://10.59.9.18/movieApi/user/v2/login"
            headers=None
            data={"email":"1478997572@qq.com","pwd":"eWLPHopE945d2ivttHaQTQ=="}
            r=requests.post(url=url,data=data)
            print(r.json())
            logging.info(r.json())
            Testcase.uid=str(r.json()['result']['userId'])
            Testcase.sid=r.json()['result']['sessionId']
        except Exception as e:
            logging.info(e)
        finally:
            print("结束")
    def test_chazhao(self):
        try:
            url="http://10.59.9.18/movieApi/movie/v2/findComingSoonMovieList"
            data={"page":1,"count":10}
            headers={"userId":str(Testcase.uid),"sessionId":Testcase.sid}
            r=requests.get(url=url,params=data,headers=headers)
            print(r.json())
            logging.info(r.json())
        except Exception as e:
            print(e)
            logging.info(e)


